home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Source / GNU / uucp / Uucp.framework / unix.subproj / sleep.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-09  |  513 b   |  27 lines

  1. /* sleep.c
  2.    Sleep for a number of seconds.  */
  3.  
  4. #include "uucp.h"
  5.  
  6. #include "sysdep.h"
  7. #include "system.h"
  8.  
  9. void
  10. usysdep_sleep (c)
  11.      int c;
  12. {
  13. #if HAVE_NAPMS || HAVE_NAP || HAVE_USLEEP || HAVE_SELECT || HAVE_POLL
  14.   int i;
  15.  
  16.   /* In this case, usysdep_pause is accurate.  */
  17.   for (i = 2 * c; i > 0; i--)
  18.     usysdep_pause ();
  19. #else
  20.   /* On some system sleep (1) may not sleep at all.  Avoid this sort
  21.      of problem by always doing at least sleep (2).  */
  22.   if (c < 2)
  23.     c = 2;
  24.   (void) sleep (c);
  25. #endif
  26. }
  27.